#include<iostream>
#include<fstream>
#include<algorithm>
#include<vector>

int Count_line(std::vector<char>*);
bool is_end(std::vector<char>::iterator);
bool is_begin(std::vector<char>::iterator);

bool is_end(std::vector<char>::iterator t)
{
	if(*t == '/' && *(t-1) == '*')
		return true;
	return false;
}

bool is_begin(std::vector<char>::iterator t)
{
	if(*t == '/' && *(t+1) == '*')
		return true;
	return false;
}

void debug(std::vector<char> *line)
{
	for(std::vector<char>::iterator i=line->begin();i!=line->end();i++)
	{
		printf("%c",*i);
	}
	return ;
}

int Count_line(std::vector<char> *line)
{
	debug(line);
	int count = 0;

	/*
	 * flag_1 : to sign if the code in the / * * / 
	 * flag_2 : to sign if the code in the //
	 * flag_3 : to sign whether there is code between the two newlines
	 */
	bool flag_1=false, flag_2=false, flag_3=false;
	if(*line->begin() == '/' && *(line->begin()+1) == '/')flag_2=true;

	for(std::vector<char>::iterator i = line->begin(); i != line->end(); i++)
	{
		if(flag_1 && is_end(i)) { flag_1 = false; continue; }
		if(flag_1)continue;
		if(is_begin(i)) { flag_1 = true; continue; }

		if(*i != '\n' )
			flag_3 = true;
		else
		{
			if( flag_3 && (!flag_2) )count++;
			flag_3 = false;
			flag_2 = false;
			if( i+1 == line->end() || i+2 ==line->end())continue;
			if( *(i+1) == '/' && *(i+2) == '/')flag_2 = true;
		}
	}

	if( (!flag_2) && ( !is_end(line->end()-1) ) && *(line->end()-1) != '\n' )count++;

	return count;
}

int main()
{
	std::vector<char> line;

	std::ifstream file;
	file.open("test.cpp");
	
	char temp;
	while(file.get(temp))
	{
		if(temp == ' ' || temp == '\t')continue;
		line.push_back(temp);
	}

	int ans;
	ans = Count(&line);
	
	printf("%d",ans);

	file.close();

	return 0;
}
